import {
	createRouter,
	createWebHistory
} from 'vue-router'

const Home =()=>import('../views/Home')
const Found = () => import('../views/Found')
const Order = () => import('../views/Order')
const Profile = () => import('../views/Profile')

import Zonghepaixu from '../components/zong-he-pai-xu/Zong-he-pai-xu'
import Xiaoliangzuigao from '../components/xiao-liang-zui-gao/Xiao-liang-zui-gao'
import Julizuijin from  '../components/ju-li-zui-jin/Ju-li-zui-jin'

import Settings from '../components/settings.vue'

import Restaurants from '../components/restaurants/index'
import Shopping from '../components/shopping/index'

import Login from '../views/longin/Login.vue'
import Register from '../views/longin/register.vue'


const routes = [
	
	{
		path: '',
		redirect: '/home/Zonghepaixu',
	},
	{
		path: '/home',
		name: 'Home',
		component: Home,
		meta: {
			title: '首页'
		},
		redirect: '/home/Zonghepaixu',
		children: [{
				path: '/home/Zonghepaixu',
				component: Zonghepaixu,
			},
			{
				path: '/home/xiaoliangzuigao',
				component: Xiaoliangzuigao
			},
			{
				path:'/home/julizuijin',
				component:Julizuijin
			}
		]
	}, {
		path: '/found',
		name: 'Found',
		component: Found,
		meta: {
			title: '发现'
		}
	}, {
		path: '/order',
		name: 'Order',
		component: Order,
		meta: {
			title: '订单'
		},
	}, {
		path: '/profile',
		name: 'Profile',
		component: Profile,
		meta: {
			title: '我的'
		},
	},
	{
		path: '/settings',
		name: 'settings',
		component: Settings,
		meta: {
			title: '设置'
		}
	},
	{
		path: '/login',
		name: 'login',
		component: Login,
		meta: {
			title: '登录'
		}
	},
	{
		path: '/register',
		name: 'register',
		component: Register,
		meta: {
			title: '新用户注册'
		}
	},
	{
	path: '/reataurants',
	name: 'restaurants',
		component:Restaurants,
		meta: {
		title: ''
		}
	},
	{
		path: '/shopping',
		name: 'shopping',
		component:Shopping,
		meta: {
			title: '我的购物车'
		}
	},
	{
		path: '/:pathMatch(.*)',
		redirect: '/home'
	}
]

const router = createRouter({
	history: createWebHistory(),
	routes
})


export default router
